# Contributor: 
# Maintainer: 
pkgname=indent
pkgver=2.2.12
pkgrel=0
pkgdesc="An indenting utility"
url="https://www.gnu.org/software/indent/"
arch="all"
license="GPL-3.0-or-later BSD"
depends=""
makedepends="gettext-dev"
install=""
subpackages="$pkgname-doc $pkgname-lang"
source="https://ftpmirror.gnu.org/indent/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	update_config_sub || return 1
	# apply patches here
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--without-included-gettext \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--without-texinfo \
		|| return 1
	make SUBDIRS="intl po src" || return 1
}

package() {
	cd "$_builddir"
	make SUBDIRS="intl po src man" DESTDIR="$pkgdir" install || return 1
	rm -rf "$pkgdir"/usr/lib/charset.alias
	rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
}

sha512sums="3fab46979779b2ac35c6ca8aaf52589ef3ccec55d41889941afb18764d5f9b6c516ea93da02e621cc42b01e87ec534c4e4bc3b6a77ba733f028a512b013c9ede  indent-2.2.12.tar.gz"
